import com.alibaba.fastjson.JSONObject;
import com.xrui.comparison.Comparator;


public class DiffJson {



    private final static String st1 = "{\"username\":\"tom\",\"age\":18,\"address\":[{\"province\":\"上海市\"},{\"city\":\"上海市\"},{\"disrtict\":\"静安区\"}]}";
    private final static String st2 = "{username:\"tom\",age:18}";

    public static void main(String[] args) {

        try{
            String actualJson = FileUtil.LoadWholeFile(args[0]);
            String expectJson = FileUtil.LoadWholeFile(args[1]);
            Object currentJsonObject = JSONObject.parse(actualJson);
            Object expectedJsonObject = JSONObject.parse(expectJson);

            Comparator comparator = new Comparator();
            JSONObject diff = comparator.diffFormatJson(currentJsonObject, expectedJsonObject);
            System.out.println(diff.toJSONString());
        }catch (Exception e){

        }

    }
}
